/**
 * elancom Corporation copy right 2012 - 2015  
 *   
 * $Header: https://192.168.1.224/svn/elancom/product/elancom-platform/trunk/src/main/java/com/elancom/framework/LimitFactory.java 1034 2012-07-02 03:09:12Z lanzhouxue $
 * $Id: LimitFactory.java 1034 2012-07-02 03:09:12Z lanzhouxue $
 * $Author: lanzhouxue $
 * $Date: 2012-07-02 11:09:12 +0800 (Mon, 02 Jul 2012) $
 * $Revision: 1034 $
 */
package com.elancom.framework.commons.limit;

import com.elancom.framework.commons.util.StringUtils;

/**
 * @author elancom
 * @date 2012-5-10
 */
public abstract class LimitFactory {
	public static Limit create() {
		return new LimitImpl();
	}

	public static Limit create(String pageStart, String pageSize) {
		if (StringUtils.isBlank(pageStart) || !StringUtils.isNumberString(pageStart)) {
			pageStart = "0";
		}

		if (StringUtils.isBlank(pageSize) || !StringUtils.isNumberString(pageSize)) {
			pageSize = "20";
		}

		final LimitImpl Limit = new LimitImpl(Integer.valueOf(pageStart), Integer.valueOf(pageSize));
		return Limit;
	}
}
